package com.dqhl.community.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.TextView;

import com.dqhl.community.R;
import com.dqhl.community.adapter.ShoppingAroundAdapter;
import com.dqhl.community.base.BaseActivity;
import com.dqhl.community.view.SectionSelectPopupWindow;

/**
 * Created by LIENLIN on 2016/9/2.
 * 周边购物
 */
public class ShoppingAroundActivity extends BaseActivity implements View.OnClickListener, AdapterView.OnItemClickListener {

    private ImageView mIvback;
    private TextView mTvTitle;
    private EditText mEtShangHu;//商户输入框
    private ImageView mImOperation;

//    private RelativeLayout mRelative;
    private ImageView mIvRight;
    private SectionSelectPopupWindow sectionSelectPopupWindow;
    private GridView mGvShopping;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_shopping_around);

        initView();
    }

    private void initView() {
        mIvback = (ImageView) findViewById(R.id.iv_top_back);
        mTvTitle = (TextView) findViewById(R.id.tv_top_title);
        mImOperation = (ImageView) findViewById(R.id.tv_top_operation);
        mEtShangHu = (EditText) findViewById(R.id.et_keshi_realtime);
        mIvRight = (ImageView) findViewById(R.id.iv_right_realtime);

        mGvShopping = (GridView) findViewById(R.id.gv_shopping);

        mIvback.setVisibility(View.VISIBLE);
        mImOperation.setVisibility(View.INVISIBLE);
        mIvback.setOnClickListener(this);
        mTvTitle.setText(R.string.txt_shoping);

        mGvShopping.setAdapter(new ShoppingAroundAdapter(this));
        mGvShopping.setOnItemClickListener(this);

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.iv_top_back:
                finish();
                break;
        }
    }
    @Override
    public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
        overlay(ShoppingDetailActivity.class);
    }
}
